package liming.ai.code.v3.data;

import java.util.ArrayList;
import java.util.List;

public class Context {
    public static final String PROJECT_PATH = "./project";
    String query;
    public Context(String query){
        this.query=query;
    }
    List<FileInfo> files=new ArrayList<>();
    public void addFile(FileInfo fileInfo){
        files.add(fileInfo);
    }
    public String getContext(){
        if(files.isEmpty())
            return "当前没有辅助文件";
        StringBuilder sb=new StringBuilder("当前辅助文件有：");
        for (FileInfo fileInfo:files){
            sb.append(fileInfo.getMdFile()).append("\n");
        }
        return sb.toString();
    }

    public List<FileInfo> getFiles(){
        return new ArrayList<>(files);
    }

    public String getQuery() {
        return query;
    }
}
